

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<html>
<head>
    <title>Title</title>
    <link type="text/css" href="/static/layui/css/layui.css" rel="stylesheet"/>
    <script type="text/javascript" src="/static/js/jquery-3.4.1.min.js"></script>
</head>
<body>

<table class="layui-hide" id="resource" lay-filter="resource"></table>
<script src="//res.layui.com/layui/dist/layui.js" charset="utf-8"></script>



<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a>
    <a class="layui-btn layui-btn-xs" lay-event="Singledel">删除</a>
</script>
<script type="text/html" id="btnDemo">
    <a class="layui-btn layui-btn-xs" lay-event="add">添加</a>
    <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
</script>

<script>
    var tobleReload;
    layui.use(['table','layer'], function(){
        var table = layui.table;
        var layer=layui.layer;

        tobleReload=table.render({
            elem: '#resource'
            ,url:'/gou/all'
            ,toolbar: '#btnDemo' //开启头部工具栏，并为其绑定左侧模板
            ,defaultToolbar: ['filter', 'exports', 'print', { //自定义头部工具栏右侧图标。如无需自定义，去除该参数即可
                title: '提示'
                ,layEvent: 'LAYTABLE_TIPS'
                ,icon: 'layui-icon-tips'
            }]
            ,title: '用户数据表'
            ,cols: [[
                {checkbox: true, fixed: true}
               , {field: 'scid', title: '购物车id', width: 80}
                , {field: 'gid', title: '商品id', width: 120}
                , {field: 'uid', title: '用户id', width: 120}
                , {field: 'num', title: '商品数量', width: 120}
                , {field: 'price', title: '商品价格', width: 120}
            ]]
            ,page: {limits: [5, 10, 15, 20, 25]}
        });

    });
</script>

</body>
</html>